home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / bridge / ScalePic.rx < prev    next >
Text File  |  2002-12-18  |  1KB  |  79 lines

  1. /*     arexx Script 
  2.     Scale Anim
  3. */
  4.  
  5.     options results
  6.     parse ARG Port Width Height Mode b
  7.     
  8.     ADDRESS value Port
  9.     /*pp_AvoidRefresh*/
  10.  
  11.     pp_AnimGui 1
  12.     if result<0 then
  13.         do
  14.             EXIT
  15.         end
  16.  
  17.     pp_GetWidth
  18.     W=result
  19.     pp_GetHeight
  20.     H=result
  21.  
  22.     pp_GetDepth
  23.     Depth=result    
  24.  
  25.     pp_GetWidthB
  26.     Wb=result
  27.     IsBrush=0
  28.     IF Wb>0 then DO
  29.         IsBrush=1
  30.         pp_Bsave "perfectpaint:Temp/brush" 0 3
  31.     END
  32.  
  33.     X2=Width/2
  34.     Y2=Height/2    
  35.  
  36.     pp_CountFrames
  37.     nb=result
  38.     IsAnim=0
  39.     if nb>1 then do
  40.         pp_SavePrefs 0 1 100 0 0
  41.         IsAnim=1
  42.         IF Depth<24 then DO
  43.             pp_Psave "ram:palette_temp" 0
  44.         END
  45.         Do i=1 to nb
  46.             pp_GotoFrame i
  47.             pp_Save 'PerfectPaint:Temp/Anim'||i 0
  48.             pp_GetJiffies
  49.             J.i=result
  50.         END
  51.         pp_New Width Height Depth
  52.         IF Depth<24 then DO
  53.             pp_Pload "ram:palette_temp"
  54.             ADDRESS COMMAND    'delete >nil: ram:palette_temp'
  55.             ADDRESS value Port
  56.         END                
  57.         pp_MakeAnim nb
  58.             pp_Bload 'PerfectPaint:Temp/Anim1'
  59.             pp_ScaleBrush Width Height
  60.             pp_Plot X2 Y2
  61.             pp_SetJiffies 1 J.1
  62.         do i=2 to nb
  63.             pp_Bload 'PerfectPaint:Temp/Anim'||i
  64.             pp_ScaleBrush Width Height
  65.             pp_NextFrame
  66.             pp_Plot X2 Y2
  67.             pp_SetJiffies i J.i
  68.             /*pp_NextFrame*/
  69.         END
  70.         pp_FreeBrush
  71.         IF IsBrush=1 then DO
  72.             pp_Bload "perfectpaint:Temp/brush"
  73.         END        
  74.         /*pp_PermitRefresh*/
  75.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  76.         EXIT
  77.     END
  78.  
  79.